package com.zhuzi.controller;

import com.zhuzi.PingUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("ping")
public class PingController {

    @GetMapping("a")
    public String ping() {
        log.info("a");
        return PingUtils.ping("http://127.0.0.1:8082/ping/b", "a", 4000);
    }

    @GetMapping("b")
    public String pingb() {
        log.info("b");
        return PingUtils.ping("http://127.0.0.1:8082/ping/c", "b", 3000);
    }

    @GetMapping("c")
    public String pingc() {
        log.info("c");
        return PingUtils.ping("http://127.0.0.1", "c", 1000);
    }


}
